# coding: utf-8
from sqlalchemy import Column, DateTime, Integer, String, Table, text
from sqlalchemy.sql.sqltypes import NullType
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()
metadata = Base.metadata


class BlogWarehouse(Base):
    __tablename__ = 'BlogWarehouse'

    id = Column(Integer, primary_key=True, unique=True)
    title = Column(String(1024), nullable=False, unique=True)
    url = Column(String(1024), nullable=False, unique=True)
    author = Column(String(64))


class SirTwoInfo(Base):
    __tablename__ = 'SirTwoInfo'

    id = Column(Integer, primary_key=True, unique=True)
    title = Column(String(256), nullable=False)
    uid = Column(String(128), nullable=False, unique=True)
    publish_date = Column(DateTime)
    author = Column(String(64))
    target_url = Column(String(256), nullable=False, unique=True)
    rank = Column(Integer)
    sexual = Column(Integer)
    lo = Column(Integer)
    grotesque = Column(Integer)
    violent = Column(Integer)
    homosexual = Column(Integer)
    drug = Column(Integer)
    thoughts = Column(Integer)
    antisocial = Column(Integer)
    religion = Column(Integer)
    original = Column(Integer)
    furry = Column(Integer)
    bl = Column(Integer)
    yuri = Column(Integer)
    has_del = Column(Integer, nullable=False, server_default=text("0"))
    img_url = Column(String(256))
    used = Column(Integer, nullable=False, server_default=text("0"))
    header = Column(String(32))


class SirTwoTag(Base):
    __tablename__ = 'SirTwoTags'

    id = Column(Integer, primary_key=True, unique=True)
    sir_two_id = Column(String(128), nullable=False, unique=True)
    tag1 = Column(String(64))
    tag2 = Column(String(64))
    tag3 = Column(String(64))
    tag4 = Column(String(64))
    tag5 = Column(String(64))
    tag6 = Column(String(64))
    tag7 = Column(String(64))
    tag8 = Column(String(64))
    tag9 = Column(String(64))
    tag10 = Column(String(64))


class TagsTranslatedName(Base):
    __tablename__ = 'TagsTranslatedName'

    id = Column(Integer, primary_key=True, unique=True)
    source_name = Column(String(64), nullable=False, unique=True)
    translated_name_google = Column(String(64))
    translated_name_youdao = Column(String(64))


class Poetry(Base):
    __tablename__ = 'poetry'

    id = Column(Integer, primary_key=True, unique=True)
    content = Column(String(512), nullable=False, unique=True)
    source = Column(String(256))
    content_source = Column(String(512))
    been_used = Column(Integer, nullable=False, server_default=text("0"))


t_sqlite_sequence = Table(
    'sqlite_sequence', metadata,
    Column('name', NullType),
    Column('seq', NullType)
)
